package com.example.kafka.service;

import com.example.kafka.pojo.IndicatorDataPo;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

@Service(value = "indicatorDataService")
public class IndicatorDataService extends CommonService {

    private static final String GROUP_NOT_EXIST_MSG_PREFIX = "分组 groupId: ";

    @Transactional
    public void insertOrUpdate(IndicatorDataPo indicator) throws Exception {
        indicatorDataDao.insertOrUpdate(indicator);
    }

    public void deleteByIndicatorId(String indicatorId) throws Exception {
        indicatorDataDao.deleteByIndicatorId(indicatorId);
    }

    public void batchInsertOrUpdate(List<IndicatorDataPo> indicators) throws Exception {
        indicatorDataDao.batchInsertOrUpdate(indicators);
    }

    /***
     * 根据系统指标id集合获取系统指标列表信息
     * @param indicatorIds
     * @return
     */
    public List<IndicatorDataPo> getIndicatorListByIndicatorIds(List indicatorIds) {
        return indicatorDataDao.getIndicatorListByIndicatorIds(indicatorIds);
    }
}
